06. Case Study: Annotations
JAVA C2 L2 03 Demo Pt 2
INSTRUCTOR NOTE:
The case study is a REST API that retrieves a list of locations from a database. The code can be cloned from GitLab.
Annotation | Description |
---|---|
@Entity | This marks a Java class as an entity, which means it will be persisted to the database. Typically, an entity maps to a database table and the table contains rows that represent that given entity. |
@RestController | This marks a class as a REST API. @RestController is a convenience annotation that combines @Controller and @ResponseBody. |
@GetMapping | This annotation handles HTTP GET requests and acts as a shortcut for @RequestMapping (method = RequestMethod.GET). |